<!--
 * @Author: WangGuojian 1085844536@qq.com
 * @Date: 2024-07-02 22:40:36
 * @LastEditTime: 2024-07-02 22:40:40
 * @LastEditors: WangGuojian 1085844536@qq.com
 * @FilePath: \html\code\2_CSS\16_CSS_盒子模型\11_CSS_margin的注意事项.html
 * @Description:
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>margin的注意事项</title>
    <style>
        .outer {
            width: 400px;
            height: 400px;
            padding: 50px;
            background-color: gray;
        }

        .inner {
            width: 100px;
            height: 100px;
            margin: 100px;
            background-color: orange;
        }
    </style>
</head>

<body>
    <!-- 子元素的 margin 是参考父元素的 content 计算的 -->
    <div class="outer">
        <div class="inner"></div>
    </div>
</body>

</html>